/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author edgar
 */
@Entity
@Table(name = "pagos")
@NamedQueries({
    @NamedQuery(name = "Pagos.findAll", query = "SELECT p FROM Pagos p"),
    @NamedQuery(name = "Pagos.findByNroRecibo", query = "SELECT p FROM Pagos p WHERE p.nroRecibo = :nroRecibo"),
    @NamedQuery(name = "Pagos.findByFecha", query = "SELECT p FROM Pagos p WHERE p.fecha = :fecha"),
    @NamedQuery(name = "Pagos.findByMonto", query = "SELECT p FROM Pagos p WHERE p.monto = :monto")})
public class Pagos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "nro_recibo")
    private Integer nroRecibo;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name = "monto")
    private Integer monto;
    @JoinColumns({
        @JoinColumn(name = "nro_factura", referencedColumnName = "nro_factura"),
        @JoinColumn(name = "nro_cuota", referencedColumnName = "nro_cuota")})
    @ManyToOne
    private CuotasACobrar cuotasACobrar;
    @JoinColumn(name = "cod_cliente", referencedColumnName = "cod_cliente")
    @ManyToOne
    private Clientes codCliente;

    public Pagos() {
    }

    public Pagos(Integer nroRecibo) {
        this.nroRecibo = nroRecibo;
    }

    public Integer getNroRecibo() {
        return nroRecibo;
    }

    public void setNroRecibo(Integer nroRecibo) {
        this.nroRecibo = nroRecibo;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Integer getMonto() {
        return monto;
    }

    public void setMonto(Integer monto) {
        this.monto = monto;
    }

    public CuotasACobrar getCuotasACobrar() {
        return cuotasACobrar;
    }

    public void setCuotasACobrar(CuotasACobrar cuotasACobrar) {
        this.cuotasACobrar = cuotasACobrar;
    }

    public Clientes getCodCliente() {
        return codCliente;
    }

    public void setCodCliente(Clientes codCliente) {
        this.codCliente = codCliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nroRecibo != null ? nroRecibo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pagos)) {
            return false;
        }
        Pagos other = (Pagos) object;
        if ((this.nroRecibo == null && other.nroRecibo != null) || (this.nroRecibo != null && !this.nroRecibo.equals(other.nroRecibo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Pagos[ nroRecibo=" + nroRecibo + " ]";
    }
    
}
